<{include file='customer/head.html'}>
<body>
	<div class="akrPop">
		<form id="sub_form">
			<ul class="ulForm">
				<li>
					<label class="form-label">登录名称：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="name" value="<{$list.name}>">
					</div>
				</li>
				<li>
					<label class="form-label">显示名称：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="displayname" value="<{$list.displayname}>">
					</div>
				</li>
				<li>
					<label class="form-label">手机号码：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="mobile" value="<{$list.mobile}>">
					</div>
				</li>
				<li>
					<label class="form-label">密码：</label>
					<div class="form-input">
						<input type="password" class="inputText" name="pwd" value="">
						<div class="form-word">密码为空,则为原密码</div>
					</div>
				</li>
				<li>
					<label class="form-label">确认密码：</label>
					<div class="form-input">
						<input type="password" class="inputText" name="pwdok" value="">
					</div>
				</li>
				<li>
					<label class="form-label">上传头像：</label>
					<div class="form-input">
						<div class="dib hcinits_uploads_file_imgshow" <{if $list.face==''}> style="display: none;" <{/if}> >
			                <img class="hcinits_uploads_file_face_images uploadImg" src="<{$list.face}>" />
			            </div>
			            <div class="akrfile">选择图片
			            	<input type="hidden" class="hcinits_uploads_file_face_name" name="face" value="<{$list.face}>">
							<div class="hcinits_uploads_file" id="uploadone"></div>
						</div>
					</div>
				</li>
				<li>
					<label class="form-label">是否超级管理员：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="isitadministrator" id="isitadministrator_1" <{if $list.isitadministrator==1}> checked <{/if}> value="1">
								<label for="isitadministrator_1">是</label>
							</dd>
							<dd>
								<input type="radio" name="isitadministrator" id="isitadministrator_0" <{if $list.isitadministrator==0}> checked <{/if}>  value="0">
								<label for="isitadministrator_0">否</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">职位：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="type" id="job_0" <{if $list.type==0}> checked <{/if}> value="0">
								<label for="job_0">研发</label>
							</dd>
							<dd>
								<input type="radio" name="type" id="job_1" <{if $list.type==1}> checked <{/if}> value="1">
								<label for="job_1">销售</label>
							</dd>
							<dd>
								<input type="radio" name="type" id="job_2" <{if $list.type==2}> checked <{/if}> value="2">
								<label for="job_2">技术</label>
							</dd>
							<dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">性别：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="sex" id="sex_male" <{if $list.sex=='男'}> checked <{/if}> value="男">
								<label for="sex_male">男</label>
							</dd>
							<dd>
								<input type="radio" name="sex" id="sex_female" <{if $list.sex=='女'}> checked <{/if}> value="女">
								<label for="sex_female">女</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">状态：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="status" id="status_0" <{if $list.status==0}> checked <{/if}> value="0">
								<label for="status_0">未启用</label>
							</dd>
							<dd>
								<input type="radio" name="status" id="status_1" <{if $list.status==1}> checked <{/if}> value="1">
								<label for="status_1">正常</label>
							</dd>
							<dd>
								<input type="radio" name="status" id="status_2" <{if $list.status==2}> checked <{/if}> value="2">
								<label for="status_2">停用</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">权限：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="checkbox" id="powerlist_1" <{if $list.powerlist & 1}> checked <{/if}> name="powerlist[]" value="1" />
								<label for="powerlist_1">创建</label>
							</dd>
							<dd>
								<input type="checkbox" id="powerlist_2" <{if $list.powerlist & 2}> checked <{/if}> name="powerlist[]" value="2" />
								<label for="powerlist_2">项目经理审核</label>
							</dd>
							<dd>
								<input type="checkbox" id="powerlist_4" <{if $list.powerlist & 4}> checked <{/if}> name="powerlist[]" value="4" />
								<label for="powerlist_4">总经理审核</label>
							</dd>
							<dd>
								<input type="checkbox" id="powerlist_8" <{if $list.powerlist & 8}> checked <{/if}> name="powerlist[]" value="8" />
								<label for="powerlist_8">研发</label>
							</dd>
							<dd>
								<input type="checkbox" id="powerlist_16" <{if $list.powerlist & 16}> checked <{/if}> name="powerlist[]" value="16" />
								<label for="powerlist_16">完成</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<div class="form-input">
						<input type="hidden" name="id" value="<{$list.id}>">
						<input type="button" class="sub_form_botton akrBtn akrBtn-md blue" value="提交">
					</div>
				</li>
			</ul>
		</form>
	</div>
	<script type="text/javascript">
		//上传单张图片
		function uploadimgone(){
			var postdata={savePath:'face'};
			var uploadid='uploadone';
			var formAction='/Ups/imageone';
			_hcinits.init(['_upload_min','_layer_admin_min'],function(){
				_layer_admin=_hcinits._layer_admin;
				_uploadfile=_hcinits._uploadfile;
				_uploadfile.initdiv({'upId':uploadid,'formAction':formAction},postdata,function(returnback){
					data=returnback[0];
	            	data=JSON.parse(data);
	            	console.log(data);
	            	if(data.status){
	            		_layer_admin.successMsg(data.message,function(){
	            			$('.hcinits_uploads_file_imgshow').show();
	            			$('.hcinits_uploads_file_face_name').val(data.img);
	            			$('.hcinits_uploads_file_face_images').attr('src',data.imgshow);
	            		});
	            	}else{
	            		_layer_admin.errorMsg(data.message);
	            	}
				});
			})
		}
		uploadimgone();
		//上传结束
		$(function(){
			//添加提交
			$('.sub_form_botton').click(function(){
				_hcinits.init(['_ajaxs_min','_layer_admin_min'],function(){
					_ajaxs=_hcinits._ajaxs;
					_layer_admin=_hcinits._layer_admin;
					 postdata=_ajaxs.from('#sub_form');
					_ajaxs.post('/User/userEdit',postdata,function(data){
						if(data.status){
							_layer_admin.successMsg(data.message,3)
						}else{
							_layer_admin.errorMsg(data.message);
						}
					})
				})
			})
		})
	</script>
</body> 
</html>